/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package CERC2011;

import java.io.BufferedOutputStream;
import java.io.BufferedWriter;
import java.io.Writer;
import java.util.Scanner;

/**
 *
 * @author andres
 */
public class B {
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        while(true){
            char[] key = sc.nextLine().toCharArray();
            if (key[0]=='0'){return;}
            char[] plain= sc.nextLine().toCharArray();
            for (int i=0;i<plain.length;i++){
                int num = (plain[i]+key[i%key.length])-128;
                num=(num%26==0)?26:num%26;
                System.out.print(((char)(num+64)));
            }
            System.out.println();
        
        }
    }
    
    
}
